﻿using System;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.Collections.Generic;
using Model;


namespace OpenLeuvenPortaal
{
    [ServiceContract(Namespace = "")]
    [SilverlightFaultBehavior]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class DevAppService
    {
            [OperationContract]
        public void DoWork()
        {
            // Add your operation implementation here
            return;
        }


            [OperationContract]
        public List<Model.Applicaty> getAllApplications()
        {
            dbopenleuvenDataContext db = new dbopenleuvenDataContext();
            var result = from a in db.Applicaties select a;
            List<Model.Applicaty> mijnApplicaties = result.ToList();

            return mijnApplicaties;
}

            [OperationContract]

        public List<Model.Rollen> getApplicationsByDeveloper()
        {
            dbopenleuvenDataContext db = new dbopenleuvenDataContext();
            var result = from a in db.Rollens join d in db.Rollens on a.RolID equals d.RolID where a.RolID == 3 select a;
            List<Model.Rollen> mijnApplicaties = result.ToList();

            return mijnApplicaties;

        }
    }
}
